﻿using System;
using System.Windows.Input;

namespace UniversalEditor.Base.MenuBarItems
{
	public class MenuCommandItem : MenuItemBase
	{
		private readonly string _name;
		private readonly string _icon;
		private readonly string _inputGestureText;
		private readonly ICommand _command;

		public MenuCommandItem(string name, string icon, string inputGestureText, ICommand command)
		{
			if (string.IsNullOrEmpty(name)) 
				throw new ArgumentNullException("name");
			if (command == null)
				throw new ArgumentNullException("command");

			_name = name;
			_icon = icon;
			_inputGestureText = inputGestureText;
			_command = command;
		}

		public override string Name
		{
			get { return _name; }
		}

		public override string Icon
		{
			get { return _icon; }
		}

		public ICommand Command
		{
			get { return _command; }
		}

		public string InputGestureText
		{
			get { return _inputGestureText; }
		}

		public override string ToString()
		{
			return _name;
		}
	}
}
